package Client;

import Server.ServerClientInstance;
import java.util.Comparator;

/**
 *
 * Class description goes here.
 *
 * @author Kamil Gajowy
 */
public class ClientCompareATime implements Comparator {

    @Override
    public int compare(Object o1, Object o2) {
        ServerClientInstance c1 = (ServerClientInstance)o1;
        ServerClientInstance c2 = (ServerClientInstance)o2;

        if (c1.getClient().getArriveTime() > c2.getClient().getArriveTime()) {
            return -1;
        }
        else if(c1.getClient().getArriveTime() == c2.getClient().getArriveTime()) {
            return 0;
        }
        else {
            return 1;
        }
    }


}//end class
